package com.river.springbootdemo.thinkingjava.objectrefer;

import java.util.*;

public class AddGroups {
    public static void main(String[] args) {
        Collection<Integer> collection=new ArrayList<>(Arrays.asList(1,2,3,4,5));
        Integer[] moreInts={6,7,8,9,10};
        collection.addAll(Arrays.asList(moreInts));
        Collections.addAll(collection,11,12,13,14,15);
        Collections.addAll(collection,moreInts);
        List<Integer> list=Arrays.asList(16,17,18,19,20);
        list.set(1,99);
        //因为是生成了固定长度集合，所以无法添加元素
//        list.add(21);
        System.out.println(collection);
        System.out.println(list);
    }
}
